package vip.liux.backend.adapter.web;

import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.liux.backend.application.service.point.PointsAccountService;
import vip.liux.backend.application.service.point.PointsAdjustDto;


@RestController
@RequestMapping("/api/points-account")
public class PointsAccountController {


    private final PointsAccountService pointsAccountService;

    public PointsAccountController(PointsAccountService pointsAccountService) {
        this.pointsAccountService = pointsAccountService;
    }

    /**
     * 后台手动调整用户积分
     */
    @PostMapping("/adjust")
    public void adjust(@RequestBody @Valid PointsAdjustDto input) {
        pointsAccountService.adjustPoints(input);
    }
}
